﻿@using res = Resource.Views.Shared.Shared;
@model IEnumerable<YQBlog.Models.blog_article> 
<div class="commentpager ajaxpager">@Html.Raw(ViewBag.AjaxPager)</div>
<div class="commentlist" id="comments"> 
<ul>
    @if ((Model as IEnumerable<YQBlog.Models.blog_article>).Count() > 0)
    {  
        foreach (var item in Model)
        {
        <li id="@item.id" f="@item.orderid" u="@item.username.Trim()" v="@item.content" class="clearfix">
            <p>
            <a href="#f_@(item.orderid)" id="f_@(item.orderid)" class="replylayer">#@(item.orderid)@Resource.Views.Home.Home.Floor</a>
            <span class="replayuser">
            @if (item.userid == 1)
            {
                <a href="@Html.YQUrl("/u/"+System.Web.HttpUtility.UrlEncode(item.username.Trim(), System.Text.Encoding.UTF8))">@item.username.Trim()</a>
            }
            else
            {
                @item.username.Trim()
            }
            </span>
            @Html.GetTime(item.createdate)
            </p>
            <div class="replyavatar">
                <img onerror="this.onerror=null;this.src='/Content/image/defaultPhoto.png';" src="/Content/Avatar/upload/avatars/@(item.username.Trim())/small.jpg"/>
            </div>
            <div class="replycontent" v="@item.content">@Html.Raw(item.content)</div>

            <div class="replyoperate">
            @if (item.userid == 1 && item.username.Trim() == User.Identity.Name)
            {
                <a href="###" class="reply-update" v="@item.id">@res.Modify</a> 
                <a href="###" class="reply-del" v="@item.id">@res.Delete</a>
            }
            <a href="###" class="reply-quote" v="@item.id">@Resource.Views.Home.Home.Quote</a> 
            <a href="###" class="reply-re" v="@item.id">@Resource.Views.Home.Home.Reply</a>
            </div>
        </li>
        }
    }
</ul>
</div>
<div class="commentpager ajaxpager">@Html.Raw(ViewBag.AjaxPager)</div>